export default {
    namespaced: true,
    state: {
        isShow: false,
        toastMsg: '默认提示内容...',
        toastType: 'warning'
    },
    mutations: {
        changeIsShowToast(state, payload) {
            state.isShow = payload.isshow;
            if (payload.isshow) {
                state.toastMsg = payload.msg;
                state.toastType = payload.type;
            }
        }
    },
    actions: {
        asyncIsShowToast({
            commit
        }, payload) {
            commit("changeIsShowToast", payload)
            setTimeout(() => {
                commit("changeIsShowToast", {
                    isshow: false
                })
            }, 2000)
        }
    }
}